package main;

import java.io.File;
import java.util.Date;

import org.apache.log4j.PropertyConfigurator;

import util.Helper;
import constants.ConstDatas;
import controlImpl.ControlImpl;

public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {

		ControlImpl control = ControlImpl.getInstance();
		control.instanciaControls();
		
		File arq = new File("C://sisgeremp//conf//log4j.properties");

		if(arq.exists()){
			System.setProperty("timestamp", Helper.getDateAsFormattedStringSeparator(new Date(),ConstDatas.SIMPLE_DATE_FORMAT_yyyyMMdd));
            PropertyConfigurator.configure("C://sisgeremp//conf//log4j.properties");
			ControlImpl controller = ControlImpl.getInstance();
			controller.allInvisible();
		}

		
		/*File arq = new File("C://controlge//conf//log4j.properties");

		if(arq.exists()){
			System.setProperty("timestamp", Helper.getDateAsFormattedStringSeparator(new Date(),ConstDatas.SIMPLE_DATE_FORMAT_yyyyMMdd));
            PropertyConfigurator.configure("C://controlge//conf//log4j.properties");
			ControlImp controller = ControlImp.getInstance();
			controller.allInvisible();
			controller.getFrame().getJMenuBar1().setVisible(false);
			controller.getFrame().getInternalFLogin().setVisible(true);
			controller.getFrame().setVisible(true);
		}
		else{
			JOptionPane.showMessageDialog(null, "Erro ao carregar o arquivo de configuracao. \n\nEntre em contato com o administrador. \n\n O programa sera finalizado!",
					"Erro",JOptionPane.ERROR_MESSAGE);
			System.exit(1);
		}*/
	}
}
